package thread.java20230113;

public class Demo61 {
    static ThreadLocal<String> threadLocal = new ThreadLocal<>();
    public static void main(String[] args) {
        Runnable runnable = ()->{
            threadLocal.set(Thread.currentThread().getName());
            System.out.println(Thread.currentThread().getName() + ":"+ threadLocal.get());
        };

        for (int i = 0; i < 10; i++) {
            new Thread(runnable).start();
        }
    }
}
